﻿CREATE TABLE [dbo].[ApplicationTeam] (
    [Id]                        INT           IDENTITY (1, 1) NOT NULL,
    [UserId]                    INT           NOT NULL,
    [ApplicationId]             INT           NOT NULL,
    [ApplicationUserFunctionId] INT           NOT NULL,
    [StartDate]                 DATETIME      NOT NULL,
    [EndData]                   DATETIME      NULL,
    [LeaveReason]               VARCHAR (255) NULL,
    FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([ApplicationId]) REFERENCES [dbo].[Application] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([ApplicationUserFunctionId]) REFERENCES [dbo].[ApplicationUserFunction] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION
);



